package leetcode_2501_2600;

import javafx.scene.effect.SepiaTone;

import java.util.HashSet;
import java.util.Set;

public class LeeCode_2554 {
    public static void main(String[] args) {

    }
    private static int maxCount(int[] banned, int n, int maxSum) {
        Set<Integer> set = new HashSet<>();
        for (int i : banned) {
            set.add(i);
        }
        int ans = 0, sum = 0;
        for (int i = 1; i <= n; i++) {
            if (set.contains(i))
                continue;
            sum += i;
            if (sum > maxSum){
                break;
            }
            ans++;
        }
        return ans;
    }
}
